﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.ServiceModel;
using System.ServiceModel.Web;
using System.ComponentModel;

namespace Chinaer.WCF.Contracts
{
    public partial interface IChinaer
    {
        [OperationContract]
        [WebGet(ResponseFormat = WebMessageFormat.Json,
            BodyStyle = WebMessageBodyStyle.Bare,
            RequestFormat = WebMessageFormat.Json,
            UriTemplate = "GetCityByProvinceID/{provinceID}/{apiToken}")]
        [Description("根据省份编号获取城市列表")]
        List<DTO.CityDTO> GetCityByProvinceID(string provinceID,string apiToken);

        [OperationContract]
        [WebInvoke(ResponseFormat = WebMessageFormat.Json,
            BodyStyle = WebMessageBodyStyle.Bare,
            RequestFormat = WebMessageFormat.Json,
            Method="POST",
            UriTemplate = "AddCity")]
        [Description("添加城市")]
        Chinaer.Model.Common.JsonResult AddCity(DTO.CityDTO cityDTO);

        [OperationContract]
        [WebInvoke(ResponseFormat = WebMessageFormat.Json,
            BodyStyle = WebMessageBodyStyle.Bare,
            RequestFormat = WebMessageFormat.Json,
            Method="POST",
            UriTemplate = "DeleteCity")]
        [Description("添加城市")]
        Chinaer.Model.Common.JsonResult DeleteCity(DTO.CityDTO cityDTO);

        [OperationContract]
        [WebGet(ResponseFormat = WebMessageFormat.Json,
            BodyStyle = WebMessageBodyStyle.Bare,
            RequestFormat = WebMessageFormat.Json,
            UriTemplate = "DeleteCityByID/{cityID}/{apiToken}")]
        [Description("根据城市编号删除城市")]
        Chinaer.Model.Common.JsonResult DeleteCityByID(string cityID, string apiToken);

        [OperationContract]
        [WebInvoke(ResponseFormat = WebMessageFormat.Json,
            BodyStyle = WebMessageBodyStyle.Bare,
            RequestFormat = WebMessageFormat.Json,
            Method="POST",
            UriTemplate = "UpdateCity")]
        [Description("更新城市")]
        Chinaer.Model.Common.JsonResult UpdateCity(DTO.CityDTO cityDTO);

    }
}
